<template>
  <!-- 大额延迟结算回执录入明细页面弹出框-->
  <el-dialog
    title="大额延迟结算回执录入明细"
    center
    :visible.sync="open"
    width="1024px"
    :close-on-click-modal="false"
    @close="closeFn"
  >
    <div v-if="this.formData.msgtype == 'hvps.115.001.01'">
      <el-form ref="settingsForm" :model="formData" label-width="158px" disabled>
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>大额延迟结算回执录入信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易流水号：" prop="id">
                <el-input v-model="formData.id" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="工作日期：" prop="workdate">
                <el-date-picker
                  v-model="formData.workdate"
                  type="date"
                  value-format="yyyyMMdd"
                  placeholder=""
                  style="width: 100%"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="业务优先级：" prop="bizPriority">
                <el-select v-model="formData.bizPriority" placeholder="" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.PRIORITY3CODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="报文标识号：" prop="pkgId">
                <el-input v-model="formData.pkgId" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="交易状态：" prop="status">
                <el-select v-model="formData.status" placeholder="" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.STATUS_115"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="来往账方向：" prop="drct">
                <el-select v-model="formData.drct" placeholder="" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.DRCTCODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="业务类型：" prop="bizTypeCode">
                <el-select v-model="formData.bizTypeCode" placeholder="" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.BANK_BIZ_TYPE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="业务种类：" prop="bizCtgyCode">
                <el-select v-model="formData.bizCtgyCode" placeholder="" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.BIZ_CTGY_HVPS_115"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
        <!--付款人信息-->
        <el-card class="form-card payerInfo-card">
          <div slot="header" class="label-header-msg">
            <span>付款人信息</span>
          </div>
          <el-row>
            <el-col :span="12">
              <el-form-item label="付款人账号" prop="payerActno">
                <el-input v-model="formData.payerActno" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="付款人名称" prop="payerName">
                <el-input v-model="formData.payerName" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-form-item label="付款人地址" prop="payerAddr">
              <el-input v-model="formData.payerAddr" placeholder="" />
            </el-form-item>
          </el-row>
          <el-row>
            <el-col :span="12">
              <div class="grid-payer">
                <el-form-item label="付款行行号" prop="payerBrno">
                  <el-input v-model="formData.payerBrno" placeholder="" />
                </el-form-item>
              </div>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <div class="grid-payer">
                <el-form-item label="付款人开户行号" prop="payerAccBrno">
                  <el-input v-model="formData.payerAccBrno" placeholder="" />
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="12">
              <el-form-item label="付款人开户行行名" prop="payerAccBrname">
                <el-input v-model="formData.payerAccBrname" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <!--收款人信息-->
        <el-card class="form-card payeeInfo-card">
          <div slot="header" class="label-header-msg">
            <span>收款人信息</span>
          </div>
          <el-row>
            <el-col :span="12">
              <el-form-item label="收款人账号" prop="payeeActno">
                <el-input v-model="formData.payeeActno" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="收款人名称" prop="payeeName">
                <el-input v-model="formData.payeeName" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>

          <el-form-item label="收款人地址" prop="payeeAddr">
            <el-input v-model="formData.payeeAddr" placeholder="" />
          </el-form-item>
          <el-row>
            <el-col :span="12">
              <el-form-item label="收款行行号" prop="payeeBrno">
                <el-input v-model="formData.payeeBrno" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="收款人开户行号" prop="payeeAccBrno">
                <el-input v-model="formData.payeeAccBrno" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="收款人开户行行名" prop="payeeAccBrname">
                <el-input v-model="formData.payeeAccBrname" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <!--其他信息-->
        <el-card class="form-card payOtherInfo-card">
          <div slot="header" class="label-header-msg">
            <span>其他交易信息</span>
          </div>
          <el-row>
            <el-col :span="12">
              <el-form-item label="中介机构1" prop="agency1">
                <acct-no-input v-model="formData.agency1" placeholder="" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="中介机构1名称" prop="agency1name">
                <el-input v-model="formData.agency1name" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="中介机构2" prop="agency2">
                <acct-no-input v-model="formData.agency2" placeholder="" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="中介机构2名称" prop="agency2name">
                <el-input v-model="formData.agency2name" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="交易货币：" prop="curcd">
                <el-input v-model="formData.curcd" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="金额：" prop="amount">
                <el-input v-model="formData.amount" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="附言" prop="remarks">
                <el-input type="textarea" v-model="formData.remarks" placeholder="" maxlength="210" show-word-limit />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
        <!--行内资金汇划信息-->
        <el-card
          class="form-card payOtherInfo-card"
          v-if="this.formData.bizCtgyCode == ('02105' || '02118' || '02119' || '02119' || '02121' || '02126')"
        >
          <div slot="header" class="label-header-msg">
            <span>行内资金汇划信息</span>
          </div>
          <el-row>
            <el-col :span="12">
              <el-form-item label="拆借期限：" prop="lendDline">
                <el-input v-model="formData.lendDline" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="拆借利率(单位:万分之一)：" prop="lendIntRate">
                <el-input v-model="formData.lendIntRate" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
        <!--跨境信息-->
        <el-card
          class="form-card payOtherInfo-card"
          v-if="this.formData.bizCtgyCode != ('02105' && '02118' && '02119' && '02119' && '02121' && '02126')"
        >
          <div slot="header" class="label-header-msg">
            <span>跨境信息</span>
          </div>
          <el-row>
            <el-col :span="12">
              <el-form-item label="关联业务委托日期：" prop="cbbizAssocBizDate">
                <el-date-picker
                  v-model="formData.cbbizAssocBizDate"
                  type="date"
                  value-format="yyyyMMdd"
                  placeholder=""
                  style="width: 100%"
                ></el-date-picker>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="费用编码：" prop="cbbizFeeCode">
                <el-input v-model="formData.cbbizFeeCode" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="发报行货币：" prop="cbbizSndbnkCurcd">
                <el-input v-model="formData.cbbizSndbnkCurcd" placeholder="" />
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="发报行的收费：" prop="cbbizSndbnkFee">
                <el-input v-model="formData.cbbizSndbnkFee" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="收报行货币：" prop="cbbizRcvbnkCurcd">
                <el-input v-model="formData.cbbizRcvbnkCurcd" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="收报行的收费：" prop="cbbizRcvbnkFee">
                <el-input v-model="formData.cbbizRcvbnkFee" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="跨境业务附言：" prop="cbbizRemark">
                <el-input
                  type="textarea"
                  v-model="formData.cbbizRemark"
                  placeholder=""
                  maxlength="210"
                  show-word-limit
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>
      <el-form ref="restForm" :model="formData" :rules="rules" label-width="158px">
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>回执信息</span>
          </div>
          <el-row>
            <el-col :span="12">
              <el-form-item label="业务回执状态：" prop="returnStatus">
                <el-select v-model="formData.returnStatus" placeholder="" style="width: 100%" @change="switchStatus">
                  <el-option
                    v-for="dict in dictMap.ACTNO_PROC_STATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <div v-if="formData.returnStatus == 'PR09'">
            <el-row type="flex">
              <el-col :span="10">
                <el-form-item label="业务拒绝处理码：" prop="bizRejectCode">
                  <el-input v-model="formData.bizRejectCode" placeholder="" @blur="getbase('REJECTCODE')" />
                </el-form-item>
              </el-col>
              <el-col :span="9">
                <el-input v-model="formData.bizRejectCodeDesc" placeholder />
              </el-col>
              <el-col :span="1"></el-col>
              <el-col :span="4">
                <el-button type="primary" plain icon="el-icon-search" @click="openBasedataDialog('REJECTCODE')">
                  请选择
                </el-button>
              </el-col>
            </el-row>
          </div>
        </el-card>
      </el-form>
      <el-form ref="settingsForm" :model="formData" label-width="158px">
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>STP</span>
          </div>
          <el-row>
            <el-col :span="12">
              <el-form-item label="non-stp类型：" prop="nstpType">
                <el-select
                  v-model="formData.nstpType"
                  disabled
                  placeholder=""
                  style="width: 100%"
                  @change="switchStatus"
                >
                  <el-option
                    v-for="dict in dictMap.STP_TYPE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="non-STP原因：" prop="nstpRemarks">
                <el-input
                  type="textarea"
                  v-model="formData.nstpRemarks"
                  placeholder=""
                  maxlength="256"
                  show-word-limit
                  disabled
                />
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="24">
              <el-form-item label="业务回执信息：" prop="returnInfo">
                <el-input
                  type="textarea"
                  v-model="formData.returnInfo"
                  placeholder=""
                  maxlength="105"
                  show-word-limit
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>
    </div>
    <div v-if="this.formData.msgtype == 'hvps.116.001.01'">
      <el-form ref="settingsForm" :model="formData" label-width="158px" disabled>
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>大额延迟结算回执录入信息</span>
          </div>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易流水号：" prop="id">
                <el-input v-model="formData.id" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="报文标识号：" prop="pkgId">
                <el-input v-model="formData.pkgId" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="工作日期：" prop="workdate">
                <el-date-picker
                  v-model="formData.workdate"
                  type="date"
                  value-format="yyyyMMdd"
                  placeholder=""
                  style="width: 100%"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="期望结算日期：" prop="isdate">
                <el-date-picker
                  v-model="formData.isdate"
                  type="date"
                  value-format="yyyyMMdd"
                  placeholder=""
                  style="width: 100%"
                ></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="交易状态：" prop="status">
                <el-select v-model="formData.status" placeholder="" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.STATUS_115"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="接收时间" prop="rcvTime">
                <el-date-picker
                  style="width: 100%"
                  v-model="formData.rcvTime"
                  value-format="yyyyMMddHHmmss"
                  type="datetime"
                />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="来往账方向：" prop="drct">
                <el-select v-model="formData.drct" placeholder="" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.DRCTCODE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="业务类型：" prop="bizTypeCode">
                <el-select v-model="formData.bizTypeCode" placeholder="" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.BANK_BIZ_TYPE"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="业务种类：" prop="bizCtgyCode">
                <el-select v-model="formData.bizCtgyCode" placeholder="" style="width: 100%">
                  <el-option
                    v-for="dict in dictMap.BIZ_CTGY_HVPS_115"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="发起参与机构：" prop="indirectSender">
                <el-input v-model="formData.indirectSender" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="发起参与机构行名" prop="indirectSenderName">
                <el-input v-model="formData.indirectSenderName" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="发起直接参与机构：" prop="directSender">
                <el-input v-model="formData.directSender" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="发起参与机构行名" prop="indirectSenderName">
                <el-input v-model="formData.indirectSenderName" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="接受参与机构：" prop="indirectRecver">
                <el-input v-model="formData.indirectRecver" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="接收参与机构行名" prop="indirectRecverName">
                <el-input v-model="formData.indirectRecverName" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="接受直接参与机构：" prop="directRecver">
                <el-input v-model="formData.directRecver" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="接受直接参与机构行名" prop="directRecverName">
                <el-input v-model="formData.directRecverName" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="划回金额交易货币：" prop="curcd">
                <el-input v-model="formData.curcd" placeholder="" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="划回金额：" prop="amount">
                <el-input v-model="formData.amount" placeholder="" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="备注：" prop="remarks">
                <el-input type="textarea" v-model="formData.remarks" placeholder="" maxlength="256" show-word-limit />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>
      <el-form ref="restForm" :model="formData" label-width="158px" :rules="rules">
        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>回执信息</span>
          </div>

          <el-row>
            <el-col :span="12">
              <el-form-item label="业务回执状态：" prop="returnStatus">
                <el-select v-model="formData.returnStatus" placeholder="" style="width: 100%" @change="switchStatus">
                  <el-option
                    v-for="dict in dictMap.ACTNO_PROC_STATUS"
                    :key="dict.value"
                    :label="`${dict.value}-${dict.text}`"
                    :value="dict.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <div v-if="formData.returnStatus == 'PR09'">
            <el-row type="flex">
              <el-col :span="10">
                <el-form-item label="业务拒绝处理码：" prop="bizRejectCode">
                  <el-input v-model="formData.bizRejectCode" placeholder="" @blur="getbase('REJECTCODE')" />
                </el-form-item>
              </el-col>
              <el-col :span="9">
                <el-input v-model="formData.bizRejectCodeDesc" placeholder />
              </el-col>
              <el-col :span="1"></el-col>
              <el-col :span="4">
                <el-button type="primary" plain icon="el-icon-search" @click="openBasedataDialog('REJECTCODE')">
                  请选择
                </el-button>
              </el-col>
            </el-row>
          </div>
          <el-row>
            <el-col :span="24">
              <el-form-item label="业务回执信息：" prop="returnInfo">
                <el-input
                  type="textarea"
                  v-model="formData.returnInfo"
                  placeholder=""
                  maxlength="105"
                  show-word-limit
                />
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="submitForm" :loading="isLoading">提交</el-button>
      <el-button type="warning" @click="reset">重置</el-button>
    </div>
    <base-data-dialog ref="basedataDialog" @confirm="confirmData"></base-data-dialog>
  </el-dialog>
</template>
<script>
import { save115, save116 } from "@/api/cnaps/baseBiz/send/hvps/hvps117.js";
import BaseDataDialog from "@/views/components/BasedataDialog";
import { getBasedata } from "@/api/cnaps/common/basedata";
import AcctNoInput from "@/views/components/AcctNoInput";

export default {
  name: "EditInfo",
  components: { BaseDataDialog, AcctNoInput },
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      // 是否显示弹出层
      open: false,
      isLoading: false,
      rules: {
        returnStatus: [
          {
            required: true,
            message: "不能为空",
            trigger: "change",
          },
        ],
        bizRejectCode: [
          {
            required: true,
            message: "不能为空",
            trigger: "blur",
          },
        ],
        agency1: [{required: false, message: "请输入中介机构1", trigger: "blur"},
          {max: 35, message: "中介机构1最长35位", trigger: "blur"}],
        agency1name: [{max: 140, message: "中介机构1名称最长140位", trigger: "blur"}],
        agency2: [{required: false, message: "请输入中介机构2", trigger: "blur"},
          {max: 35, message: "中介机构2最长35位", trigger: "blur"}],
        agency2name: [{max: 140, message: "中介机构2名称最长140位", trigger: "blur"}]
      },
    };
  },
  mounted() {
    console.log(this.formData);
  },
  methods: {
    // 表单重置
    reset() {
      this.resetForm("restForm");
      this.$set(this.formData, "returnInfo", "");
    },
    closeFn() {
      this.open = false;
      this.reset();
    },
    show() {
      this.open = true;
    },
    switchStatus(val) {
      console.log(val, "业务状态");
      if (val == "PR05") {
        this.$set(this.formData, "bizRejectCode", "");
        this.$set(this.formData, "bizRejectCodeDesc", "");
        this.$set(this.formData, "bizRejectInfo", "");
      }
    },
    // 选择业务拒绝处理码弹框方法
    openBasedataDialog(dataType = "") {
      this.$refs.basedataDialog.show(dataType);
    },
    confirmData(dataType, row) {
      console.log(row);
      this.$set(this.formData, "bizRejectCode", row.dataValue);
      this.$set(this.formData, "bizRejectCodeDesc", row.dataDesc);
    },
    getbase(dataType) {
      let dataValue = this.formData.bizRejectCode;
      if (dataValue) {
        getBasedata(dataType, dataValue)
          .then((res) => {
            if (res.code == "S" && res.result !== null) {
              this.$set(this.formData, "bizRejectCode", res.result.dataValue);
              this.$set(this.formData, "bizRejectCodeDesc", res.result.dataDesc);
            } else {
              this.msgSuccess("找不到对应的字典项");
              this.$set(this.formData, "bizRejectCodeDesc", null);
            }
          })
          .catch((err) => {
            this.$set(this.formData, "bizRejectCodeDesc", null);
          });
      }
    },
    submitForm() {
      this.$refs["restForm"].validate((valid) => {
        if (valid && this.formData.msgtype == "hvps.115.001.01") {
          this.isLoading = true;
          save115(this.formData)
            .then((res) => {
              this.$alert(`CORE_ID: ${res.result.rspId}`, "生成交易流水号", {
                confirmButtonText: "确定",
                callback: (action) => {
                },
              });
              this.msgSuccess("提交成功！");
              this.isLoading = false;
              this.open = false;
              this.$emit("editComplete", true);
            })
            .catch((err) => {
              this.isLoading = false;
            });
        } else if (valid && this.formData.msgtype == "hvps.116.001.01") {
          this.isLoading = true;
          save116(this.formData)
            .then((res) => {
              this.$alert(`CORE_ID: ${res.result.rspId}`, "生成交易流水号", {
                confirmButtonText: "确定",
                callback: (action) => {
                },
              });
              this.msgSuccess("提交成功！");
              this.isLoading = false;
              this.open = false;
              this.$emit("editComplete", true);
            })
            .catch((err) => {
              this.isLoading = false;
            });
        }
      });
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
